// authStore.js
import { types } from 'mobx-state-tree';

const User = types.model({
  id: types.number,
  name: types.string,
  email: types.string,
  // 可能还有其他属性...
});

const AuthStore = types.model({
  user: types.maybe(User), // 使用 User 模型定义 user 属性
}).actions(self => ({
  setUser(user) {
    self.user = user;
  },
  clearUser() {
    self.user = null;
  },
}));

export default AuthStore;
